from flask import Flask
from os import system

app = Flask(__name__)


# 第一个参数为地址，只改x508server即可
@app.route('/webhook/push/x508server', methods=['POST'])
def x508server_webhook():
    """
    执行x508server-pull.sh脚本，注意脚本中的路径
    :return:
    """
    system('bash x508server-pull.sh')
    return 'ok'


if __name__ == '__main__':
    app.run(host='0.0.0.0')
